package clsr.info.blog.common.event;

import lombok.Getter;

@Getter
public class ArticleEvent extends BaseEvent {
  /** 文章 id */
  private Integer id;

  /** 类型 */
  private Type type;

  @Getter
  public enum Type {
    READ(1, "浏览"),
    PRAISE(2, "点赞"),
    COMMENT_ADD(3, "新增评论"),
    COMMENT_MINUS(4, "减少评论");

    Integer code;
    String remark;

    Type(int code, String remark) {
      this.code = code;
      this.remark = remark;
    }
  }

  public ArticleEvent(Integer id, Type type, EventEnum eventEnum) {
    this.eventEnum = eventEnum;
    this.id = id;
    this.type = type;
  }
}
